/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.yunhoo.fee.bean;

import com.yunhoo.sys.db.util.IbatisTemplate;
import com.yunhoo.sys.util.common.CommonParam;
import com.yunhoo.sys.util.common.LoginParam;
import com.yunhoo.sys.util.common.Null;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import javax.servlet.ServletContext;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFFooter;
import org.apache.poi.hssf.usermodel.HSSFHeader;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.Region;
import org.apache.poi.ss.usermodel.CreationHelper;

@ManagedBean(name = "danghui")
@SessionScoped
public class DangHuiBean {

    private final String NAME_SPACE = "testconct.";
    private Integer iyear;
    private Integer monthBegin = 1;
    private Integer monthEnd = 12;
    //
    private String[] dangAddArr;//党费 加项 数组
    private String[] dangCutArr;//党费 减项 数组
    private String[][] dangHeader;
    private Object[][] dangData;
    //
    private String[] huiAddArr;//会费 加项 数组
    private String[] huiCutArr;//会费 减项 数组
    private String[][] huiHeader;
    private Object[][] huiData;

    public DangHuiBean() {
//        Login login = (Login) FacesUtils.getManagedBean("login");
//        cpsn_number = login.getUser().getCpsn_number();
       // iyear = LoginParam.getIyear();
        initDangArr();
        initDangHeader();
        initHuiArr();
        initHuiHeader();
        iyear = CommonParam.defaultYear();
        listDangFeiForPerson();
        listHuiFeiForPerson();
    } 
    
    private String getOrgCode() {
        System.out.println("org : " + LoginParam.getOrg());
        System.out.println("org : " + LoginParam.getOrg().getCode());
        return LoginParam.getOrg().getCode();
    }

    private void initDangArr() {
        String orgCode = getOrgCode();
        Map map = new HashMap();
        map.put("orgCode", orgCode);
        String dangf = (String) IbatisTemplate.query(NAME_SPACE + "getFeeExpressDang", map);//党费计算表达式
        System.out.println("initDangArr dangf : " + dangf);
        if (Null.check(dangf)) {
            return;
        }
        dangf = dangf.replaceAll("\\s*", "");//去除空格 制表符
        String[] arr = dangf.split("-", 2);//将表达式分成 加项 和 减项 两部分

        dangAddArr = arr[0].split("\\+");//所有加项

        if (arr.length == 2) {
            if (arr[1].startsWith("(")) {
                //减项是用括弧包起来的
                dangCutArr = arr[1].substring(1, arr[1].length() - 1).split("\\+");
            } else {
                //减项没有用括弧包起来的
                dangCutArr = arr[1].split("-");
            }
        }
        //System.out.println("dangAddArr :  " + Arrays.toString(dangAddArr));
        //System.out.println("dangCutArr :  " + Arrays.toString(dangCutArr));
    }

    private void initDangHeader() {
        System.out.println("dangAddArr.length : " + dangAddArr);
        System.out.println("dangAddArr.length : " + dangAddArr.length);
        Map<String, String> gzhMap = queryGzHeaderMap();
        if (dangCutArr != null && dangCutArr.length > 0) {
            //System.out.println("有 减项 !");
            String[] dh1 = {"月份", "基数", "减项", "小计", "党费"};
            String[] dh2 = new String[dangAddArr.length + dangCutArr.length];
            for (int a = 0; a < dangAddArr.length; a++) {
                dh2[a] = gzhMap.get(dangAddArr[a]);
            }
            for (int c = 0; c < dangCutArr.length; c++) {
                dh2[dangAddArr.length + c] = gzhMap.get(dangCutArr[c]);
            }
            dangHeader = new String[][]{dh1, dh2};
        } else {
            //System.out.println("没有 减项 !");
            String[] dh1 = {"月份", "基数", "小计", "党费"};
            String[] dh2 = new String[dangAddArr.length];
            for (int a = 0; a < dangAddArr.length; a++) {
                dh2[a] = gzhMap.get(dangAddArr[a]);
            }
            dangHeader = new String[][]{dh1, dh2};
        }
    }

    private void initHuiArr() {
        Map map = new HashMap();
        map.put("orgCode", LoginParam.getOrg().getCode());
        String dangf = (String) IbatisTemplate.query(NAME_SPACE + "getFeeExpress", map);//党费计算表达式
        if (Null.check(dangf)) {
            return;
        }
        dangf = dangf.replaceAll("\\s*", "");//去除空格 制表符
        String[] arr = dangf.split("-", 2);//用第一个 减号 将字符串分成两部分

        huiAddArr = arr[0].split("\\+");//所有加项

        if (arr.length == 2) {
            if (arr[1].startsWith("(")) {
                huiCutArr = arr[1].substring(1, arr[1].length() - 1).split("\\+");
            } else {
                huiCutArr = arr[1].split("-");
            }
        }
    }

    private void initHuiHeader() {
        Map<String, String> gzhMap = queryGzHeaderMap();
        if (huiCutArr != null && huiCutArr.length > 0) {
            //System.out.println("有 减项 !");
            String[] dh1 = {"月份", "基数", "减项", "小计", "会费"};
            String[] dh2 = new String[huiAddArr.length + huiCutArr.length];
            for (int a = 0; a < huiAddArr.length; a++) {
                dh2[a] = gzhMap.get(huiAddArr[a]);
            }
            for (int c = 0; c < huiCutArr.length; c++) {
                dh2[huiAddArr.length + c] = gzhMap.get(huiCutArr[c]);
            }
            huiHeader = new String[][]{dh1, dh2};
        } else {
            //System.out.println("没有 减项 !");
            String[] dh1 = {"月份", "基数", "小计", "会费"};
            String[] dh2 = new String[huiAddArr.length];
            for (int a = 0; a < huiAddArr.length; a++) {
                dh2[a] = gzhMap.get(huiAddArr[a]);
            }
            huiHeader = new String[][]{dh1, dh2};
        }
    }

    public void queryDangFeiForPerson() {
        listDangFeiForPerson();
    }
    private void listDangFeiForPerson(){
        Map map = new HashMap();
        map.put("orgCode", LoginParam.getOrg().getCode());
        map.put("iyear", iyear);
        map.put("cpsn_number", curPerNum());
        map.put("monthBegin", monthBegin);
        map.put("monthEnd", monthEnd);
        map.put("outerParam", outerParam(dangAddArr, dangCutArr));
        map.put("innerParam", innerParam(dangAddArr, dangCutArr));
        List<Map<String, String>> li = (ArrayList<Map<String, String>>) IbatisTemplate.queryForList(NAME_SPACE + "queryListDangHuiForPerson", map);
        int addLen = dangAddArr.length;
        int cutLen;
        if (dangCutArr != null && dangCutArr.length > 0) {
            cutLen = dangCutArr.length;
        } else {
            cutLen = 0;
        }
        int left_offset = 1;//左偏移量(月份 1列)
        int right_offset = 2;//右偏移量(小计、党费 2列)
        dangData = new Object[li.size()][left_offset + addLen + cutLen + right_offset];
        for (int i = 0; i < li.size(); i++) {
            Map row = li.get(i);
            dangData[i][0] = row.get("imonth") == null ? "小计" : row.get("imonth");
            for (int a = 0; a < addLen; a++) {
                //System.out.println("dangAddArr[a] : " + a + " - " + dangAddArr[a]);
                dangData[i][a + left_offset] = row.get((String) dangAddArr[a]);
            }
            if (cutLen != 0) {
                for (int c = 0; c < cutLen; c++) {
                    dangData[i][c + left_offset + addLen] = row.get((String) dangCutArr[c]);
                }
            }
            dangData[i][left_offset + addLen + cutLen + right_offset - 2] = row.get("addTotal");
            dangData[i][left_offset + addLen + cutLen + right_offset - 1] = row.get("dangfei");
        }        
    }

    public void queryHuiFeiForPerson() {
        listHuiFeiForPerson();
    }
    
    private void listHuiFeiForPerson(){
        Map map = new HashMap();
        map.put("orgCode", LoginParam.getOrg().getCode());
        map.put("iyear", iyear);
        map.put("cpsn_number", curPerNum());
        map.put("monthBegin", monthBegin);
        map.put("monthEnd", monthEnd);
        map.put("outerParam", outerParam(huiAddArr, huiCutArr));
        map.put("innerParam", innerParam(huiAddArr, huiCutArr));
        List<Map<String, String>> li = (ArrayList<Map<String, String>>) IbatisTemplate.queryForList(NAME_SPACE + "queryListDangHuiForPerson", map);
        int addLen = huiAddArr.length;
        int cutLen;
        if (huiCutArr != null && huiCutArr.length > 0) {
            cutLen = huiCutArr.length;
        } else {
            cutLen = 0;
        }
        int left_offset = 1;//左偏移量(月份 1列)
        int right_offset = 2;//右偏移量(党费 1列)
        huiData = new Object[li.size()][left_offset + addLen + cutLen + right_offset];
        for (int i = 0; i < li.size(); i++) {
            Map row = li.get(i);
            huiData[i][0] = row.get("imonth") == null ? "小计" : row.get("imonth");
            for (int a = 0; a < addLen; a++) {
                huiData[i][a + left_offset] = row.get((String) huiAddArr[a]);
            }
            if (cutLen != 0) {
                for (int c = 0; c < cutLen; c++) {
                    huiData[i][c + left_offset + addLen] = row.get((String) huiCutArr[c]);
                }
            }
            huiData[i][left_offset + addLen + cutLen + right_offset - 2] = row.get("addTotal");
            huiData[i][left_offset + addLen + cutLen + right_offset - 1] = row.get("huifei");
        }
    }

    private String innerParam(String[] addArr, String[] cutArr) {
        String param = "";
        for (String a1 : addArr) {
            param += ",sum(" + a1 + ") " + a1;
        }
        param = param.substring(1);
        if (cutArr != null && cutArr.length > 0) {
            for (String a2 : cutArr) {
                param += ",sum(" + a2 + ") " + a2;
            }
        }
        //System.out.println("param : " + param);
        return param;
    }

    private String outerParam(String[] addArr, String[] cutArr) {
        String param = "";
        String addTotal = "";
        for (String a1 : addArr) {
            param += ",isnull(" + a1 + ",0) " + a1;
            addTotal += "+isnull(" + a1 + ",0)";
        }
        param = param.substring(1);
        addTotal = addTotal.substring(1);
        if (cutArr != null && cutArr.length > 0) {
            for (String a2 : cutArr) {
                param += ",isnull(" + a2 + ",0) " + a2;
                addTotal += "-isnull(" + a2 + ",0)";
            }
        }
        param = param + "," + addTotal + " addTotal";
        System.out.println("param : " + param);
        return param;
    }

    private Map<String, String> queryGzHeaderMap() {
        Map gzHeaderMap = IbatisTemplate.queryForMap(NAME_SPACE + "queryGzHeaderMap", null, "key", "value");
        return gzHeaderMap;
    }

    public void exportExcel() {
        if (dangData != null) {
            HSSFWorkbook demoWorkBook = new HSSFWorkbook();
            HSSFSheet demoSheet = demoWorkBook.createSheet("个人党费");
            String[][] excelColumns = initTabeleHeader();
            Object[][] rows = dangData;

            HSSFHeader header = demoSheet.getHeader();
            header.setCenter("个人党费");
            HSSFRow headerRow = demoSheet.createRow(1);
            for (int i = 0; i < dangHeader[1].length; i++) {
                HSSFCell headerCell = headerRow.createCell((short) i + 1);
                //headerCell.setEncoding(HSSFCell.ENCODING_UTF_16);
                headerCell.setCellValue(excelColumns[1][i].toString());
                System.out.println("excelColumns[i]:" + excelColumns[1][i]);
            }
            //填充数据
            int rowIndex = 2;
            for (Object[] row : rows) {
                createTableRow(demoWorkBook, demoSheet, row, rowIndex, dangHeader, dangAddArr, dangCutArr);
                rowIndex++;
            }
            exportExcel(demoWorkBook, demoSheet);
        }
    }
    //初始化表头信息

    public String[][] initTabeleHeader() {
        String[][] excelColumns = dangHeader;
        System.out.println("dangHeader@@@:" + dangHeader[0].length);
        System.out.println("dangHeader@@@:" + dangHeader[1].length);
        return excelColumns;
    }

    public static void createTableRow(HSSFWorkbook demoWorkBook, HSSFSheet demoSheet, Object[] dangData,
            int rowIndex, String[][] dangHeader, String[] dangAddArr, String[] dangCutArr) {
        //创建第rowIndex行
        //HSSFWorkbook workbook = new HSSFWorkbook();
        CreationHelper createHelper = demoWorkBook.getCreationHelper();
        HSSFCellStyle dstyle = demoWorkBook.createCellStyle();
        dstyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("0.00"));
        HSSFFont font = demoWorkBook.createFont();
        font.setFontName("黑体");
        font.setFontHeightInPoints((short) 12);//设置字体大小
        HSSFCellStyle cellStyle = demoWorkBook.createCellStyle();
        cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
        cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
        //cellStyle.setFont(font);//选择需要用到的字体格式

        HSSFCell cell1 = null;
        HSSFRow row1 = demoSheet.createRow(0);
        if (dangCutArr != null && dangCutArr.length > 0) {
            demoSheet.addMergedRegion(new Region((short) 0, (short) 0, (short) 1, (short) 0));
            demoSheet.addMergedRegion(new Region((short) 0, (short) 1, (short) 0, (short) dangAddArr.length));
            demoSheet.addMergedRegion(new Region((short) 0, (short) (dangAddArr.length + 1), (short) 0, (short) (dangAddArr.length + dangCutArr.length)));
            demoSheet.addMergedRegion(new Region((short) 0, (short) (dangAddArr.length + dangCutArr.length + 1), (short) 1, (short) (dangAddArr.length + dangCutArr.length + 1)));
            demoSheet.addMergedRegion(new Region((short) 0, (short) (dangAddArr.length + dangCutArr.length + 2), (short) 1, (short) (dangAddArr.length + dangCutArr.length + 2)));
        } else {
            demoSheet.addMergedRegion(new Region((short) 0, (short) 0, (short) 1, (short) 0));
            demoSheet.addMergedRegion(new Region((short) 0, (short) 1, (short) 0, (short) dangAddArr.length));
            demoSheet.addMergedRegion(new Region((short) 0, (short) (dangAddArr.length + 1), (short) 1, (short) (dangAddArr.length + 1)));
            demoSheet.addMergedRegion(new Region((short) 0, (short) (dangAddArr.length + 2), (short) 1, (short) (dangAddArr.length + 2)));
        }
        cell1 = row1.createCell(0);
        cell1.setCellValue("月份");
        cell1.setCellStyle(cellStyle);
        cell1 = row1.createCell(1);
        cell1.setCellValue("基数");
        cell1.setCellStyle(cellStyle);
        if (dangCutArr != null && dangCutArr.length > 0) {
            cell1 = row1.createCell(dangAddArr.length + 1);
            cell1.setCellValue("减项");
            cell1.setCellStyle(cellStyle);
            cell1 = row1.createCell(dangAddArr.length + dangCutArr.length + 1);
            cell1.setCellValue("小计");
            cell1.setCellStyle(cellStyle);
            cell1 = row1.createCell(dangAddArr.length + dangCutArr.length + 2);
            cell1.setCellValue("党费");
            cell1.setCellStyle(cellStyle);
        } else {
            cell1 = row1.createCell(dangAddArr.length + 1);
            cell1.setCellValue("小计");
            cell1.setCellStyle(cellStyle);
            cell1 = row1.createCell(dangAddArr.length + 2);
            cell1.setCellValue("党费");
            cell1.setCellStyle(cellStyle);
        }


        HSSFCell cell = null;
        HSSFRow row = demoSheet.createRow(rowIndex);
        for (int i = 0; i < dangHeader[1].length + 3; i++) {
            cell = row.createCell(i);
            if (i == 0) {
                cell.setCellValue(dangData[i].toString().trim());
            } else {
                Double data1 = Double.parseDouble(dangData[i].toString().trim());
                //System.out.println("data3 : " + String.format("%.2f", data1));
                cell.setCellValue(data1);
                cell.setCellStyle(dstyle);
            }
        }
    }

    public void exportExcelHui() {
        if (huiData != null) {
            HSSFWorkbook demoWorkBook = new HSSFWorkbook();
            HSSFSheet demoSheet = demoWorkBook.createSheet("个人党费");
            String[][] excelColumns = initTabeleHeaderHui();
            Object[][] rows = huiData;

            HSSFHeader header = demoSheet.getHeader();
            header.setCenter("个人党费");
            HSSFRow headerRow = demoSheet.createRow(1);
            for (int i = 0; i < huiHeader[1].length; i++) {
                HSSFCell headerCell = headerRow.createCell((short) i + 1);
                //headerCell.setEncoding(HSSFCell.ENCODING_UTF_16);
                headerCell.setCellValue(excelColumns[1][i].toString());
                System.out.println("excelColumns[i]:" + excelColumns[1][i]);
            }
            //填充数据
            int rowIndex = 2;
            for (Object[] row : rows) {
                createTableRowHui(demoWorkBook, demoSheet, row, rowIndex, huiHeader, huiAddArr, huiCutArr);
                rowIndex++;
            }
            exportExcel(demoWorkBook, demoSheet);
        }
    }
    //初始化表头信息

    public String[][] initTabeleHeaderHui() {
        String[][] excelColumns = huiHeader;
        return excelColumns;
    }

    public static void createTableRowHui(HSSFWorkbook demoWorkBook, HSSFSheet demoSheet, Object[] huiData,
            int rowIndex, String[][] huiHeader, String[] huiAddArr, String[] huiCutArr) {
        //创建第rowIndex行
        //HSSFWorkbook workbook = new HSSFWorkbook();
        CreationHelper createHelper = demoWorkBook.getCreationHelper();
        HSSFCellStyle dstyle = demoWorkBook.createCellStyle();
        dstyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("0.00"));
        HSSFFont font = demoWorkBook.createFont();
        font.setFontName("黑体");
        font.setFontHeightInPoints((short) 12);//设置字体大小
        HSSFCellStyle cellStyle = demoWorkBook.createCellStyle();
        cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
        cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
        //cellStyle.setFont(font);//选择需要用到的字体格式

        HSSFCell cell1 = null;
        HSSFRow row1 = demoSheet.createRow(0);
        if (huiCutArr != null && huiCutArr.length > 0) {
            demoSheet.addMergedRegion(new Region((short) 0, (short) 0, (short) 1, (short) 0));
            demoSheet.addMergedRegion(new Region((short) 0, (short) 1, (short) 0, (short) huiAddArr.length));
            demoSheet.addMergedRegion(new Region((short) 0, (short) (huiAddArr.length + 1), (short) 0, (short) (huiAddArr.length + huiCutArr.length)));
            demoSheet.addMergedRegion(new Region((short) 0, (short) (huiAddArr.length + huiCutArr.length + 1), (short) 1, (short) (huiAddArr.length + huiCutArr.length + 1)));
            demoSheet.addMergedRegion(new Region((short) 0, (short) (huiAddArr.length + huiCutArr.length + 2), (short) 1, (short) (huiAddArr.length + huiCutArr.length + 2)));
        } else {
            demoSheet.addMergedRegion(new Region((short) 0, (short) 0, (short) 1, (short) 0));
            demoSheet.addMergedRegion(new Region((short) 0, (short) 1, (short) 0, (short) huiAddArr.length));
            demoSheet.addMergedRegion(new Region((short) 0, (short) (huiAddArr.length + 1), (short) 1, (short) (huiAddArr.length + 1)));
            demoSheet.addMergedRegion(new Region((short) 0, (short) (huiAddArr.length + 2), (short) 1, (short) (huiAddArr.length + 2)));
        }
        cell1 = row1.createCell(0);
        cell1.setCellValue("月份");
        cell1.setCellStyle(cellStyle);
        cell1 = row1.createCell(1);
        cell1.setCellValue("基数");
        cell1.setCellStyle(cellStyle);
        if (huiCutArr != null && huiCutArr.length > 0) {
            cell1 = row1.createCell(huiAddArr.length + 1);
            cell1.setCellValue("减项");
            cell1.setCellStyle(cellStyle);
            cell1 = row1.createCell(huiAddArr.length + huiCutArr.length + 1);
            cell1.setCellValue("小计");
            cell1.setCellStyle(cellStyle);
            cell1 = row1.createCell(huiAddArr.length + huiCutArr.length + 2);
            cell1.setCellValue("会费");
            cell1.setCellStyle(cellStyle);
        } else {
            cell1 = row1.createCell(huiAddArr.length + 1);
            cell1.setCellValue("小计");
            cell1.setCellStyle(cellStyle);
            cell1 = row1.createCell(huiAddArr.length + 2);
            cell1.setCellValue("会费");
            cell1.setCellStyle(cellStyle);
        }


        HSSFCell cell = null;
        HSSFRow row = demoSheet.createRow(rowIndex);
        for (int i = 0; i < huiHeader[1].length + 3; i++) {
            cell = row.createCell(i);
            if (i == 0) {
                cell.setCellValue(huiData[i].toString().trim());
            } else {
                Double data1 = Double.parseDouble(huiData[i].toString().trim());
                //System.out.println("data3 : " + String.format("%.2f", data1));
                cell.setCellValue(data1);
                cell.setCellStyle(dstyle);
            }
        }
    }

    public static void exportExcel(HSSFWorkbook demoWorkBook, HSSFSheet demoSheet) {
        try {
            String strfileName = "book.xls";
            FileOutputStream fos = null;
            //导出
            demoSheet.setGridsPrinted(true);//demoSheet
            HSSFFooter footer = demoSheet.getFooter();
            footer.setRight("Page " + HSSFFooter.page() + " of " + HSSFFooter.numPages());
            // 获得JSF上下文环境
            FacesContext context = FacesContext.getCurrentInstance();
            // 获得ServletContext对象
            ServletContext servletContext = (ServletContext) context.getExternalContext().getContext();
            // 取得文件的绝对路径
            String excelName = servletContext.getRealPath("/upload") + "/" + strfileName;//strfileName
            File exportFile = new File(excelName);
            fos = new FileOutputStream(exportFile);//fos
            demoWorkBook.write(fos);//demoWorkBook
            fos.close();

            FacesContext ctx = FacesContext.getCurrentInstance();
            ctx.responseComplete();
            HttpServletResponse httpServletResponse = (HttpServletResponse) ctx.getExternalContext().getResponse();
            ServletOutputStream servletOutputStream = httpServletResponse.getOutputStream();
            httpServletResponse.setHeader("Content-disposition", "attachment; filename=" + strfileName);//strfileName
            httpServletResponse.setContentLength((int) exportFile.length());//exportFile
            httpServletResponse.setContentType("application/x-download");
            //httpServletResponse.setContentType("application/vnd.ms-excel");
            byte[] b = new byte[1024];
            int i = 0;
            FileInputStream fis = new java.io.FileInputStream(exportFile);
            while ((i = fis.read(b)) > 0) {
                servletOutputStream.write(b, 0, i);
            }
            servletOutputStream.flush();
            ctx.responseComplete();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private String curPerNum() {
        return LoginParam.getPer().getCpsn_number();
    }

    public Integer getIyear() {
        return iyear;
    }

    public void setIyear(Integer iyear) {
        this.iyear = iyear;
    }

    public Integer getMonthBegin() {
        return monthBegin;
    }

    public void setMonthBegin(Integer monthBegin) {
        this.monthBegin = monthBegin;
    }

    public Integer getMonthEnd() {
        return monthEnd;
    }

    public void setMonthEnd(Integer monthEnd) {
        this.monthEnd = monthEnd;
    }

    public String[] getDangAddArr() {
        return dangAddArr;
    }

    public void setDangAddArr(String[] dangAddArr) {
        this.dangAddArr = dangAddArr;
    }

    public String[] getDangCutArr() {
        return dangCutArr;
    }

    public void setDangCutArr(String[] dangCutArr) {
        this.dangCutArr = dangCutArr;
    }

    public String[][] getDangHeader() {
        return dangHeader;
    }

    public void setDangHeader(String[][] dangHeader) {
        this.dangHeader = dangHeader;
    }

    public Object[][] getDangData() {
        return dangData;
    }

    public void setDangData(Object[][] dangData) {
        this.dangData = dangData;
    }

    public String[] getHuiAddArr() {
        return huiAddArr;
    }

    public void setHuiAddArr(String[] huiAddArr) {
        this.huiAddArr = huiAddArr;
    }

    public String[] getHuiCutArr() {
        return huiCutArr;
    }

    public void setHuiCutArr(String[] huiCutArr) {
        this.huiCutArr = huiCutArr;
    }

    public String[][] getHuiHeader() {
        return huiHeader;
    }

    public void setHuiHeader(String[][] huiHeader) {
        this.huiHeader = huiHeader;
    }

    public Object[][] getHuiData() {
        return huiData;
    }

    public void setHuiData(Object[][] huiData) {
        this.huiData = huiData;
    }
}
